﻿Public Class perUF
    Inherits PersistenciaPadrao.AcessoBD

    Public Function selecionaDadosEstado(ByVal iCodEstado As Int32) As DataTable
        Dim sSql As String

        sSql = "SELECT codEstado, sigla" & Environment.NewLine &
               "  FROM end_estado" & Environment.NewLine
        If iCodEstado > 0 Then
            sSql &= " WHERE codEstado=@codUF" & Environment.NewLine
        End If
        sSql &= "ORDER BY sigla ASC"

        MyBase.limparParametros()
        If iCodEstado > 0 Then
            MyBase.inserirParametro("@codUF", iCodEstado)
        End If

        Return MyBase.executarConsulta(sSql, True)

    End Function

End Class
